package dem1;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.function.Consumer;
import java.util.function.IntFunction;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-04-06
 * Time: 8:12
 */
public class Test {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"艾莉西亚","牙医","琪亚娜","记者","出生","鸡蛋","坤坤");
        list.stream().forEach(s ->System.out.print(s + " "));
        //System.out.println(list);
        System.out.println();
        System.out.println(list.stream().count());
       String[] strings = list.stream().toArray(new IntFunction<String[]>() {
           @Override
           public String[] apply(int value) {
               return new String[value];
           }
       });
        System.out.println(Arrays.toString(strings));
    }
}
